--头文件
local skynet = require "skynet"
--读取配置选项
local portConf = skynet.getenv "port" 
local maxCliConf = skynet.getenv "maxClient" 

--入口
skynet.start(function()
	skynet.error("==========Wg start==========")

	--终端输出
	if not skynet.getenv "daemon" then
		local console = skynet.newservice("console")
	end

	--终端输出
	skynet.newservice("debug_console", 1008)
	skynet.error("==========debug_console on:", 1008)

	--看门狗监听
	local watchdog = skynet.newservice("watchdog")
	skynet.call(watchdog, "lua", "start", {
		port = portConf,
		maxclient = tonumber(maxCliConf),
		nodelay = true,
	})
	skynet.error("==========Watchdog listen on", 1001)
	
	--sproto
	skynet.uniqueservice("sprotoSave")
	skynet.error("==========SprotoSave===========")
	

	skynet.exit()
end)
